app.service('z-salaryDetail-s', [
    '$rootScope',
    '$z-http',
    'ZModel',
    function ($rootScope, $http, ZModel) {
        var service = {
            getSalaryList: function (data, success, fault) {
                $http.post("salary/getSalaryTempList.do", data)
                    .success(function (data) {
                        success(data.success);
                    }).error(function (data) {
                    fault(data);
                });
            },
            getSalaryHistory: function (data, success, fault) {
                $http.post("salary/getSalaryHistory.do", data)
                    .success(function (data) {
                        success(data.success);
                    })
                    .error(function (data) {
                        fault(data);
                });
            },
            getExportSalary: function (data, success, fault) {
                $http.post("salary/getExportSalary.do", data)
                    .success(function (data) {
                        success(data.success);
                    }).error(function (data) {
                    fault(data);
                });
            },
            updateSalaryList: function (data, success, fault) {
                $http.post("salary/updateSalaryList.do", data)
                    .success(function (data) {
                        success(data.success);
                    }).error(function (data) {
                    fault(data);
                });
            },
            getSalaryListDetail: function (data, success, fault) {
                $http.post("salary/getSalaryListDetail.do",
                    $.param(data),
                    {headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}})
                    .success(function (data) {
                        success(data.success);
                    }).error(function (data) {
                    fault(data);
                });
            },
            saveSalaryListExcel: function(data, success, fault) {
                $http.post("salary/saveSalaryListExcel.do",
                    $.param(data),
                    {headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}})
                    .success(function (data) {
                        success(data.success);
                    }).error(function (data) {
                    fault(data);
                });
            },
            getSalaryImportYearMonth: function (data, success, fault) {
                $http.post("salary/getExcelYearMonth.do",
                    $.param(data),
                    {headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}})
                    .success(function (data) {
                        success(data.success);
                    }).error(function (data) {
                    fault(data);
                });
            },
			deleteSalary : function(data,success,fault) {
                $http.post("salary/deleteSalary.do", data)
	                .success(function (data) {
	                    success(data.success);
	                }).error(function (data) {
	                fault(data);
	            });
			},
			getSalaryTotalList: function (data, success, fault) {
                $http.post("salary/getSalaryTotalList.do", data)
                    .success(function (data) {
                        success(data.success);
                    }).error(function (data) {
                    fault(data);
                });
            }
        };
        return service;
    }]);